<!--title-->
<div class="mnav1">
	<div class="m_nav">
		<div class="nav_left">
			<em class="home_icon"><?=$this->sys_name?></em><span>&nbsp;&gt;&nbsp;</span><font><?=$this->title?></font>
		</div>
	</div>
</div>

<div class="content-table">
<div class="content-table-title"><?=$this->title?></div>
<br />
<?php if($this->msg):?>
<div class="replace"><?=$this->msg?></div>
<br />
<?php endif;?>
<form action="/maozhua/index-data-yc" name="form1" method="GET">
公司名称：<input type="text" name="keyword" <?php if($this->keyword){echo "value='".$this->keyword."'";}?> />
&nbsp;&nbsp;&nbsp;&nbsp;
记录日期：<input type="text" name="date_start" id="date_start" autocomplete="off" style="width: 100px"> ~ <input type="text" name="date_end" id="date_end" autocomplete="off" style="width: 100px">
&nbsp;&nbsp;&nbsp;&nbsp;
<br>
易车开关：
<select name="account_status">
    <option value="">请选择</option>
    <option value="0" <?php if(isset($this->account_status) && $this->account_status==0){echo 'selected=selected';}?>>关闭</option>
    <option value="1" <?php if($this->account_status==1){echo 'selected=selected';}?>>开启</option>
</select>
&nbsp;&nbsp;&nbsp;&nbsp;
易车状态：
<select name="status_yc">
    <option value="">请选择</option>
    <option value="1" <?php if($this->status_yc==1){echo 'selected=selected';}?>>下线</option>
    <option value="2" <?php if($this->status_yc==2){echo 'selected=selected';}?>>正常</option>
</select>
&nbsp;&nbsp;&nbsp;&nbsp;
易车满分：
<select name="yc_manfen">
    <option value="">请选择</option>
    <option value="1" <?php if($this->yc_manfen==1){echo 'selected=selected';}?>>否</option>
    <option value="2" <?php if($this->yc_manfen==2){echo 'selected=selected';}?>>是</option>
</select>
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" class="button" value="搜索" />
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" class="button-cancle" value="清空搜索条件" onclick="location.href='?';" />
</form>
<br />
<table>
  <tr>   
    <th>公司</th>
    <th>记录时间</th>
	<th>开关</th>
    <th>状态</th>
    <th>总分</th>
    <th>满分</th>
    <th>降价车款得分</th>
    <th>置换车款得分</th>
	<th>APP状态</th>
	<th>APP得分</th>
	<th>400接起得分</th>
    <th>有效新闻得分</th>
    <th>降价文章覆盖度</th>
    <th>置换文章覆盖度</th>
	
  </tr>

    <?php $data = $this->data['current_page_info'];?>
    <?php if($data["log_id"]):?>
        <?php foreach($data["log_id"] as $id => $something):?>
  
  <?php
	$zj_score = "";
	$zj_manfen = "";
	$zj_minger = "";
	$zj_fugai = "";



	if($data['status_zj'][$id])
	{
		$data_zj = Zend_Json::decode($data['data_zj'][$id]);

		$zj_score_arr = array();

		if($data_zj['data']['yunying'])
		{
			foreach($data_zj['data']['yunying'] as $fdata)
			{
				$zj_score_arr[] = $fdata['totalScore'];
			}

			$zj_score = implode("/", $zj_score_arr);
		}

		$zj_manfen = $data_zj['data']['manfen']?"<font color='green'>是</font>":"<font color='red'>否</font>";                
            
		$haofei = $data_zj['data']['haofei']?$data_zj['data']['haofei']:0;
		$zongedu = ($data_zj['data']['haofei']+$data_zj['data']['shengyu'])?($data_zj['data']['haofei']+$data_zj['data']['shengyu']):0;

		$zj_minger = $haofei."/".$zongedu;

		$series1 = 0; //有文章
		$series2 = 0; //总数

		if($data_zj['data']['series'])
		{
			foreach($data_zj['data']['series'] as $se)
			{
				$series2 += 1;
				
				$str = str_replace("）", "", $se['_name']);
				$ex = explode("（", $str);

				if(2 == count($ex))
				{
					if(0 < $ex[1])
					{
						$series1 += 1;
					}
				}
			}
		}
		
		$zj_fugai = $series1."/".$series2;
		
		if($series1 != $series2)
		{
			$zj_fugai = "<font color='red'>".$zj_fugai."</font>";
		}
	}

	$yc_score = "";
	$yc_manfen = "";
	$yc_topic1 = "";
	$yc_topic2 = "";
	$jiangjia_scroe = "";
	$zhihuan_scroe = "";
	$app_signin_scroe = "";
	$yc_pickup_score = "";
	$avail_news_score = "";

	if($data['status_yc'][$id])
	{
		$data_yc = Zend_Json::decode($data['data_yc'][$id]);

		$yc_score_arr = array();

		if($data_yc['data']['yunying'])
		{
			foreach($data_yc['data']['yunying'] as $fdata)
			{
				$yc_score_arr[] = $fdata['totalScore'];
			}

			$yc_score = implode("/", $yc_score_arr);
		}

		$yc_manfen = $data_yc['data']['isScore100']?"<font color='green'>是</font>":"<font color='red'>否</font>";
		$yc_topic1 = $data_yc['data']['jiangjiaNewsCover']?$data_yc['data']['jiangjiaNewsCover']:"-";
		$yc_topic2 = $data_yc['data']['zhihuanNewsCover']?$data_yc['data']['zhihuanNewsCover']:"-";
		$jiangjia_scroe = $data_yc['data']['jiangjiaScroe'];
		$zhihuan_scroe = $data_yc['data']['zhihuanScore'];
		$app_signin_scroe = $data_yc['data']['appSigninScore'];
		$yc_pickup_score = $data_yc['data']['pickupScore'];
		$avail_news_score = $data_yc['data']['availNewsScore'];

	}
  ?>
  
  <tr>   
    <td><?=$data['user_name'][$id]?></td>
    <td><?=$data['ctime'][$id]?></td>
	<td><?=$data['status'][$id]?"<font color='green'>开启</font>":"<font color='red'>关闭</font>"?></td>
    <td><?=$data['status_yc'][$id]?"<font color='green'>正常</font>":"<font color='red'>下线</font>"?></td>
    <td><?=$yc_score?></td>
    <td><?=$yc_manfen?></td>
    <td><?=$jiangjia_scroe?></td>
    <td><?=$zhihuan_scroe?></td>
	<?php if($data['app_status'][$id]==1){ ?>
		<td style="color:green;">是</td>
	<?php }elseif($data['app_status'][$id]==0){ ?>
		<td style="color:red;">否</td>
	<?php }else{ ?>
		<td>未开通</td>
	<?php }?>
	<td><?php if($app_signin_scroe > 0){ echo $app_signin_scroe;} ?></td>
	<td><?php if($yc_pickup_score >0){ echo $yc_pickup_score;}?></td>
	<td><?php if($avail_news_score>0){ echo $avail_news_score;}?></td>
    <td><?=$yc_topic1?></td>
    <td><?=$yc_topic2?></td>
  </tr>
  <?php endforeach;?>
  <?php endif;?>
</table>
    <br /><br />
    <div align="right"><?=$this->pagination?></div>
    <br /><br /><br />
<br /><br />

    <script>
        var date = new Date();//获取当前时间
        date.setDate(date.getDate()-1);

        $(function() {
            $( "#date_start" ).datepicker({ dateFormat: 'yy-mm-dd'}).datepicker("setDate", "<?=$this->date_start?>");
        });

        $(function() {
            $( "#date_end" ).datepicker({ dateFormat: 'yy-mm-dd'}).datepicker("setDate", "<?=$this->date_end?>");
        });
    </script>